package com.kingre.et.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * T分
 * 
 * @author Jingui.Yu
 * 
 */
@Entity
@Table(name = "t_tdata")
public class Tdata extends BaseObject implements Serializable {
    private static final long serialVersionUID = -7427991997994763347L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @ManyToOne(targetEntity = User.class)
    @JoinColumn(name = "user_id")
    private User user;

    // 1：性别；2：年级；3：学历；123：综合
    @Column(name = "model_type")
    private Integer modelType;

    // 自信心
    private Float v1;
    // 责任心
    private Float v2;
    // 团队合作
    private Float v3;
    // 适应能力
    private Float v4;
    // 创新能力
    private Float v5;
    // 专业技能
    private Float v6;
    // 实践经验
    private Float v7;
    // 自我定位
    private Float v8;
    // 求职方法
    private Float v9;
    // 总分
    @Column(name = "v_all")
    private Float vAll;

    public Tdata() {
    }

    public Tdata(User user, Integer modelType) {
        this.modelType = modelType;
        this.user = user;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Integer getModelType() {
        return modelType;
    }

    public void setModelType(Integer modelType) {
        this.modelType = modelType;
    }

    public Float getV1() {
        return v1;
    }

    public void setV1(Float v1) {
        this.v1 = v1;
    }

    public Float getV2() {
        return v2;
    }

    public void setV2(Float v2) {
        this.v2 = v2;
    }

    public Float getV3() {
        return v3;
    }

    public void setV3(Float v3) {
        this.v3 = v3;
    }

    public Float getV4() {
        return v4;
    }

    public void setV4(Float v4) {
        this.v4 = v4;
    }

    public Float getV5() {
        return v5;
    }

    public void setV5(Float v5) {
        this.v5 = v5;
    }

    public Float getV6() {
        return v6;
    }

    public void setV6(Float v6) {
        this.v6 = v6;
    }

    public Float getV7() {
        return v7;
    }

    public void setV7(Float v7) {
        this.v7 = v7;
    }

    public Float getV8() {
        return v8;
    }

    public void setV8(Float v8) {
        this.v8 = v8;
    }

    public Float getV9() {
        return v9;
    }

    public void setV9(Float v9) {
        this.v9 = v9;
    }

    public Float getVAll() {
        return vAll;
    }

    public void setVAll(Float vAll) {
        this.vAll = vAll;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof Tdata)) {
            return false;
        }
        final Tdata rawdata = (Tdata) o;
        return this.hashCode() == rawdata.hashCode();
    }

    @Override
    public int hashCode() {
        return (user != null ? user.hashCode() : 0);
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append("user", user.toString()).append("v1", v1)
                .append("v2", v2).append("v3", v3).append("v4", v4).append("v5", v5).append("v6", v6).append("v7", v7)
                .append("v8", v8).append("v9", v9).append("vAll", vAll).toString();
    }

}
